package com.atung.merchant.enums;

import lombok.Getter;

/**
 * @author Administrator
 */
@Getter
public enum MenuState {
    AWAIT("未出餐"),
    COMPLETE("已出餐"),
    CANCEL("已取消");

    public String name;

    MenuState(String name) {
        this.name = name;
    }

    public static MenuState getMenuState(int code) {
        for (MenuState state : MenuState.values()) {
            if (state.ordinal() == code) {
                return state;
            }
        }
        return null;
    }

    public static String getName(int code) {
        for (MenuState state : MenuState.values()) {
            if (state.ordinal() == code) {
                return state.name;
            }
        }
        return null;
    }

}
